package ncs.common.model;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * @author Jian
 *
 */
public class User {
	protected int dbID;			//数据库ID,数据库自动生成
	protected String userID;		//用户ID,如学生的学号或者教师学工号等
	protected String password;
	protected int authority;		//权限 0:管理员 1:老师 2:学生
	public int getDbID() {
		return dbID;
	}
	public void setDbID(int dbID) {
		this.dbID = dbID;
	}
	public String getUserID() {
		return userID;
	}
	public void setUserID(String userID) {
		this.userID = userID;
	}
	@JSONField(serialize = false)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@JSONField(serialize = false)
	public int getAuthority() {
		return authority;
	}
	public void setAuthority(int authority) {
		this.authority = authority;
	}
	public boolean isStudent()
	{
		return this.getAuthority()==2;
	}
	public boolean isTeacher()
	{
		return this.getAuthority()==1;
	}
	public boolean isAdmin()
	{
		return this.getAuthority()==0;
	}
}

